<?php
use yii\widgets\ActiveForm;
use kartik\file\FileInput;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\bootstrap\Modal;
use yii\helpers\Url;
?>
<style type="text/css">
	.data-form label{
		color: white;
	}

	.data-form h1,h2,h3{
		color: white;
	}
</style>
<?php $form = ActiveForm::begin([
	'options' => ['enctype'=>'multipart/form-data'],
	]); ?>
<div class="row data-form" style="width: 80%; margin: 0px auto; padding-top: 20px; padding-bottom: 20px;background: gray;">
	<h3 style="text-align:center;"><?=$pageTitle?></h3>
	<hr/>
	<div class="col-lg-6">
		<?=$form->field($article, 'title')->textInput()?>
		<?=$form->field($article, 'short_title')->textInput()?>
		<?=$form->field($article, 'description')->textarea(['rows' => 12])?>
        <?=$form->field($article, 'cid')->dropDownList(ArrayHelper::map($clists, 'id', 'name', 'pid'),['prompt'=>'选择分类'])?>
        <?=$form->field($article, 'image_id')->widget(\noam148\imagemanager\components\ImageManagerInputWidget::className(), [
            'aspectRatio' => (18/9), //set the aspect ratio
            'showPreview' => true, //false to hide the preview
            'showDeletePickedImageConfirm' => false, //on true show warning before detach image
        ]);?>
        <div style="display: none">
			<?=$form->field($article, 'image_id_list')->label(false)->hiddenInput()?>
		</div>
	</div>
	
	<div class="col-lg-6">
		<?= $form->field($article, 'content')->widget(\yii\redactor\widgets\Redactor::className(), [ 
		    'clientOptions' => [ 
		        'imageManagerJson' => ['/redactor/upload/image-json'], 
		        'imageUpload' => ['/redactor/upload/image'], 
		        'fileUpload' => ['/redactor/upload/file'], 
		        'lang' => 'zh_cn', 
		        'plugins' => ['clips', 'fontcolor','imagemanager'],
		        'minHeight' => '500px',
		    ],
		]) ?>
	</div>
	<div class="col-lg-12">
		<?=Html::submitButton('提交', ['class'=>'btn btn-primary btn-block','name' =>'submit-button'])?>
	</div>
</div>
<?php ActiveForm::end(); ?>
